package pl.edu.agh.nn.training;

import java.util.ArrayList;
import java.util.List;

import pl.edu.agh.nn.conf.InvalidNetworkConfigurationException;

public abstract class AbstractTrainingCaseProvider implements TrainingCaseProvider {

	protected List<TrainingCase> trainingCases;

	@Override
	public TrainingCase nextData() {
		int index = (int) Math.floor((Math.random() * (trainingCases.size() - 1)) + 0.5f);
		return trainingCases.get(index);
	}

	@Override
	public void configure() throws InvalidNetworkConfigurationException {
		trainingCases = new ArrayList<TrainingCase>();
	}

}
